import java.util.Scanner;

/*算法思想：用max表示经过的数字长度最大值，count表示数字长度计数器，当为字母时重置为0
*end表示数字尾部，每次满足数字时，对max进行判断，当max小于于count时，更新max和end
*/
public class Main{
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            String str = sc.nextLine();
            //对输入进行判断
            if(str == null || str.length() == 0) return ;
            int maxSize = 0, end = 0, count = 0;
            int i = 0;
            while(i < str.length()){
                if(str.charAt(i) >= '0' && str.charAt(i) <= '9'){
                    count++;
      //判断maxSize和count大小，当count交大时，更新maxSzie和end
                    if(maxSize < count){
                        maxSize = count;
                        end = i;
                    }
                }else{
                    count = 0;
                }
                i++;
            }
            //截取出最长的字符串并打印出来
            System.out.print(str.substring(end-maxSize+1,end+1));
        }
    }
}